package zkrt.cc.fishelevatorservice.feign;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import zkrt.cc.fishelevatorservice.common.Constant;
import zkrt.cc.fishelevatorservice.feign.user.*;


import java.util.List;
import java.util.Map;

@FeignClient(name= Constant.SERVICE_SMW_CODE,
        url = "${feignUrl.smw}")
public interface SmwClient {


    @GetMapping({"/smw/Dict/GetDictByKindAndNo"})
    Result<DictModel> getDictionaryNameByKindNo(@RequestParam("kind")  String kind,
                                                @RequestParam("dictionaryNo") String dictionaryNo);


    @GetMapping({"/smw/Dict/GetDictByKind"})
    Result<List<DictModel>> getDictByKind(@RequestParam("kind")  String kind);




    @GetMapping({"/smw/Account/FindAll"})
    Result<List<UserResult>> FindAll();

    @PostMapping({"/smw/UAC/CPLogin"})
    Result<String> getLoginResult(UserInfoVO userInfoVO);

    /**
     * 获取角色列表
     */
    @GetMapping({"/smw/Role/FindAll"})
    Result<List<UserRole>> getRoleList();

    /**
     * 获取角色用户信息列表
     */
    @GetMapping({"/smw/Role/GetRoleWithUsers"})
    Result<UserRole> getRoleUserList(@RequestParam("Id") String Id);

    /**
     * 获取用户详情
     *
     * @param id
     * @return
     */
    @GetMapping({"/smw/Account/GetAccountDetail"})
    Result<UserResult> getAccountDetail(@RequestParam("UserGUID") String id);


    /**
     * 获取所有部门信息
     *
     * @return
     */
    @GetMapping({"/smw/Department/GetSimple"})
    Result<List<DepartmentResult>> getDeptsAll();

    /**
     * 通过access_token获取用户信息
     *
     * @param access_token
     * @return
     */
    @GetMapping({"/smw/UAC/OauthUserInfo"})
    Result<Map<String, Object>> oauthUserInfo(@RequestParam(value = "access_token") String access_token);



    /**
     * 通过access_token获取用户信息
     *
     * @param access_token
     * @return
     */
    @GetMapping({"/smw/UAC/GetUserTokenData"})
    Result<Map<String, Object>> GetUserTokenData(@RequestParam(value = "access_token") String access_token);


    /**
     *
     * 获取登录用户信息
     */
    @GetMapping({"/smw/UAC/GetUserInfo"})
    Result<Map<String,Object>> getUserInfo();

    /**
     *
     * @param categoryNo
     * @param log
     * @return
     */
    @GetMapping({"/smw/ConfigOptions/GetSettingByCategoryNo"})
    Result<Map<String, Object>> getSettingByCategoryNo(@RequestParam(value = "categoryNo") String categoryNo, @RequestParam(value = "$$$log") String log);

    /**
     * 保存 账户数据
     */
    @PostMapping({"/smw/Account/SaveAccount"})
    Result<String> saveAccount(UserInfoVO uiv);

    /**
     * 删除用户
     */
    @DeleteMapping({"/smw/Account/DeleteAccount"})
    Result<String> deleteAccount(@RequestParam("id")String id);

    @PostMapping({"/smw/Account/UpdateAccount"})
    Result<String> updateAccount(UserInfoVO uiv);

    @PostMapping({"/smw/Account/DisableAccount"})
    Result<String> disableAccount(String requestJson);

    @PostMapping({"/smw/Account/GetSomeAccountByCode"})
    Result<List<UserList>> GetSomeAccountByCode(@RequestBody List<String> userCode);

}
